/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.gui.mvc.model.testbed;

import org.testis.gui.mvc.controller.testbed.DeviceGroupDetailController;
import org.testis.gui.mvc.model.AbstractModel;
import org.testis.orm.testbed.refined.DeviceGroupDetailRefined;

/**
 *
 * @author selcuk
 */
public class DeviceGroupDetailModel extends AbstractModel {

    private DeviceGroupDetailRefined m_DetailRefined = null;
    private Integer m_detailId = 0;
    private Integer m_deviceGroupId = 0;
    private Integer m_pcId = 0;
    private String m_macAddress = "";
    private String m_ip = "";
    private Integer m_port = 0;
    private Integer m_osId = 0;
    private Boolean m_isRemote = false;
    private String m_name = "";
    private String m_lastError = "";
    private Boolean m_visibility = false;

    public void setVisibility(Boolean val) {
        if (val == null) {
            return;
        }
        Boolean oldVal = m_visibility;
        m_visibility = val;
        firePropertyChange(DeviceGroupDetailController.VISIBLE_PROPERTY,
                oldVal,
                val);
    }

    public Boolean getVisibility() {
        return m_visibility;
    }

    public String getName() {
        return m_name;
    }

    public void setName(String name) {
        if (name == null) {
            name = "";
        }
        String oldName = m_name;
        m_name = name;
        firePropertyChange(DeviceGroupDetailController.NAME_PROPERTY,
                oldName,
                name);
    }

    public String getLastError() {
        return m_lastError;
    }

    public void setLastError(String val) {
        if (val == null) {
            val = "";
        }
        String oldValue = m_lastError;
        m_lastError = val;
        firePropertyChange(DeviceGroupDetailController.ERROR_PROPERTY, null,
                m_lastError);
    }

    /**
     * @return the m_detailId
     */
    public Integer getDetailId() {
        return m_detailId;
    }

    /**
     * @param val the m_deviceId to set
     */
    public void setDetailId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_detailId;
        this.m_detailId = val;
        firePropertyChange(DeviceGroupDetailController.DETAIL_ID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_deviceMapId
     */
    public Integer getDeviceGroupId() {
        return m_deviceGroupId;
    }

    /**
     * @param val the m_deviceMapId to set
     */
    public void setDeviceGroupId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_deviceGroupId;
        this.m_deviceGroupId = val;
        firePropertyChange(DeviceGroupDetailController.GROUPID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_deviceMapId
     */
    public Integer getPcId() {
        return m_pcId;
    }

    /**
     * @param val the m_deviceMapId to set
     */
    public void setPcId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_pcId;
        this.m_pcId = val;
        firePropertyChange(DeviceGroupDetailController.PCID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_macAddress
     */
    public String getMacAddress() {
        return m_macAddress;
    }

    /**
     * @param val the m_macAddress to set
     */
    public void setMacAddress(String val) {
        if (val == null) {
            val = "";
        }
        String oldName = m_macAddress;
        this.m_macAddress = val;
        firePropertyChange(DeviceGroupDetailController.MACADDRESS_PROPERTY,
                oldName,
                val);
    }

    /**
     * @return the m_macAddress
     */
    public String getIp() {
        return m_ip;
    }

    /**
     * @param val the m_macAddress to set
     */
    public void setIp(String val) {
        if (val == null) {
            val = "";
        }
        String oldName = m_ip;
        this.m_ip = val;
        firePropertyChange(DeviceGroupDetailController.IP_PROPERTY,
                oldName,
                val);
    }

    /**
     * @return the m_firmwareId
     */
    public Integer getPort() {
        return m_port;
    }

    /**
     * @param val the m_firmwareId to set
     */
    public void setPort(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_port;
        this.m_port = val;
        firePropertyChange(DeviceGroupDetailController.PORT_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_osId
     */
    public Integer getOsId() {
        return m_osId;
    }

    /**
     * @param val the m_osId to set
     */
    public void setOsId(Integer val) {
        if (val == null) {
            return;
        }
        Integer oldVal = m_osId;
        this.m_osId = val;
        firePropertyChange(DeviceGroupDetailController.OSID_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_isRemote
     */
    public Boolean getIsRemote() {
        return m_isRemote;
    }

    /**
     * @param val the m_isRemote to set
     */
    public void setIsRemote(Boolean val) {
        if (val == null) {
            return;
        }
        Boolean oldVal = m_isRemote;
        this.m_isRemote = val;
        firePropertyChange(DeviceGroupDetailController.ISREMOTE_PROPERTY,
                oldVal,
                val);
    }

    /**
     * @return the m_DetailRefined
     */
    public DeviceGroupDetailRefined getDetailRefined() {
        return m_DetailRefined;
    }

    /**
     * @param val the m_DetailRefined to set
     */
    public void setDetailRefined(DeviceGroupDetailRefined val) {
        if (val == null) {
            return;
        }
        DeviceGroupDetailRefined oldVal = m_DetailRefined;
        this.m_DetailRefined = val;
        firePropertyChange(DeviceGroupDetailController.DETAIL_REFINED_PROPERTY,
                oldVal,
                val);
    }
}
